
class Message<T> {
    public T str;
   public void setMessage(T str) {
       this.str = (T)str;
   }
   public T getStr() {
       return (T)str;
   }
}

public class TestDemo {

    //通配符 可以接收任意类型
    public static void func1(Message<?> t) {
        System.out.println(t.getStr());
    }
    public static void main(String[] args) {
        Message<String> message = new Message();
        message.setMessage("小比特,大梦想!");
        System.out.println(message.getStr());
        func1(message);

    }

}
